var xmlHttp;

function showHint(str){
	if (str.length==0){
		document.getElementById("texthint").innerHTML="";
		return;
	}
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null){
	alert("don't support Http Reguest!");
	return;
}
var url="juduo.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=statechange;
xmlHttp.open("Get",url,true);
xmlHttp.send();
}

function statechange(){
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete"){
		document.getElementById("texthint").innerHTML=xmlHttp.responseText
	}
}

function GetXmlHttpObject () {
	// body...
	var xmlHttp = null;
	try{
		xmlHttp = new XMLHttpRequest();
	}
	catch(e) {
		try {
			xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(e) {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}